home *** CD-ROM | disk | FTP | other *** search
Text File | 1992-09-02 | 3.2 KB | 97 lines | [TEXT/CCL2] |
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;;make-menus.lisp
- ;;
- ;; Copyright © 1992 University of Toronto, Department of Computer Science
- ;; All Rights Reserved
- ;;
- ;; author: Mark A. Tapia
- ;;
- ;; Defines the components of the menus package. Load this file after
- ;; loading "init-menus". Change the logical directory if the files
- ;; are not stored in the subdirectory "ccl;menu enhancements:"
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
- (unless (find-package :menu-enhancements)
- (defpackage :menu-enhancements
- (:use :common-lisp :ccl)
- (:nicknames :menus)))
-
- (in-package :menus)
- (require 'quickdraw)
- ;; mcl-final is true iff version is "Version 2.0f"
- (defparameter mcl-final cl-user::mcl-final)
- (in-package :menus)
- ;; change the directory to reflect your directory structure
-
- ;; MCL2.0f uses logical-pathname-translations not def-logical-directory
- (defparameter *menus-files* (list (format nil "~amarking-menu" cl-user::menu-dir)
- (format nil "~acheck-menu-item" cl-user::menu-dir)))
- (defparameter *menus-support-files* (list (format nil "~aoou-utils" cl-user::menu-dir)))
- (defparameter marking-demo (format nil "~amarking-demo" cl-user::menu-dir))
- (defparameter hier-demo (format nil "~ahier-demo" cl-user::menu-dir))
-
- (defvar *loaded-menus-files* '())
-
- (export '(load-menus load-marking-demo load-hier-demo) :menus)
-
- (defun compile-if-changed (file always)
- (let* ((source (merge-pathnames file ".lisp"))
- (fasl (merge-pathnames file ".fasl")))
- (unless (probe-file source)
- (error "file not found: ~s" file))
- (when (or always
- (not (probe-file fasl))
- (< (file-write-date fasl)
- (file-write-date source)))
- (compile-file source :output-file fasl :verbose t))))
-
- (defun load-if-changed (file always)
- (compile-if-changed file nil)
- (let* ((fasl (merge-pathnames file ".fasl"))
- (date (file-write-date fasl))
- (last-load (assoc file *loaded-menus-files* :test #'equalp)))
- (when (or always
- (not last-load)
- (< (cdr last-load)
- date))
- (load fasl :verbose t)
- (if last-load
- (setf (cdr last-load) date)
- (push (cons file date) *loaded-menus-files*)))))
-
- (defun compile-menus (&optional always)
- (with-compilation-unit ()
- (load-menus-support))
- (with-compilation-unit ()
- (dolist (file *menus-files*)
- (compile-if-changed file always))))
-
- ;(compile-menus)
- ;(compile-menus t)
-
- (defun load-menus-support ()
- (dolist (file *menus-support-files*)
- (load-if-changed file nil)))
-
- ;(load-menus-support)
-
- (defun load-menus ()
- (with-compilation-unit ()
- (load-menus-support))
- (with-compilation-unit ()
- (dolist (file *menus-files*)
- (load-if-changed file nil))))
-
- (defun load-demos ()
- (load-menus)
- (with-compilation-unit ()
- (load-if-changed "marking-menu-demo" nil)
- (load-if-changed "hier-menu-demo" nil)))
-
- #|
- (load-menus) ; to load the menus
- (load-demos) ; to load the marking-demo and hier-marking-demo
- (cl-user::marking-demo) ; to test the marking demo after loading
- (cl-user::hier-demo) ; to test the hier demo after loading
-
- |#